<?php
/**
 * 统计博文数量
 * @author wangtao
 * @version 
 */

define('IN_WT', true);
include 'include.php';
include 'config.php';

$db = mysqlDB::con();
#所有博客列表
$sql1 = 'SELECT `BID` FROM `blog_info`';
$blogARR = $db->getOneArr($sql1);

foreach ($blogARR as $BID)
{
	#获得文章总数
	$sql2 = 'SELECT COUNT(0) FROM `post_into` WHERE `BID` =' . $BID;
	$num = $db->query2one($sql2);
	$sql3 = 'UPDATE `feed`.`blog_info` SET `countNUM` = \'' . $num . '\' WHERE `blog_info`.`BID` =' . $BID . ' LIMIT 1';
	mysql_query($sql3) or die('BID:' . $BID . "\n" . $sql3 . "\n" . mysql_error());
}
